package com.angel.service.ServiceImpl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.angel.bean.Branches;
import com.angel.mapper.BranchesDao;
import com.angel.service.BranchesService;

@Service
public class BranchesServiceImpl implements BranchesService{

    @Resource
    private BranchesDao branchesDao;

    @Override
    public int insert(Branches branches){
        return branchesDao.insert(branches);
    }

    @Override
    public int insertSelective(Branches branches){
        return branchesDao.insertSelective(branches);
    }

    @Override
    public int insertList(List<Branches> branchess){
        return branchesDao.insertList(branchess);
    }

    @Override
    public int update(Branches branches){
        return branchesDao.update(branches);
    }

    @Override
    public Branches findOneBranches(Branches branches) {
        List<Branches> list =branchesDao.findAll(branches);
        if (list==null || list.isEmpty()){
            return null;
        }
        return list.get(0);
    }

    @Override
    public List<Branches> findAll(Branches branches){
        return branchesDao.findAll(branches);
    }

    @Override
    public List<Branches> searchBranches(Branches branches){
        return branchesDao.searchBranches(branches);
    }

    @Override
    public int delete(Branches branches) {
        return branchesDao.delete(branches);
    }
}


